package com.huige.controller;

import com.huige.pojo.vo.PortalVo;
import com.huige.service.HeadlineService;
import com.huige.service.TypeService;
import com.huige.service.UserService;
import com.huige.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 朱志辉
 * @Create 2024/7/23 下午5:27
 * @Version 1.0
 * Description:
 */
@RequestMapping("portal")
@RestController
@CrossOrigin//解决前后端跨域问题
public class PortalController {

    @Autowired
    private TypeService typeService;

    @Autowired
    private HeadlineService headlineService;

    @GetMapping("findAllTypes")
    public Result findAllTypes() {
        Result result = typeService.findAllTypes();
        return result;
    }


    @PostMapping("findNewsPage")
    public Result findNeewsPage(@RequestBody PortalVo portalVo) {
            Result result =headlineService.findNewsPage(portalVo);
            return result;
    }

    @PostMapping("showHeadlineDetail")
    public Result showHeadlineDetail(Integer hid) {
        Result result = headlineService.showHeadlineDetail(hid);
        return result;
    }




}



















